//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Chart
{
    public class SeriesAxis : Axis
    {
        private int? tickLabelSkip;

        private int? tickMarkSkip;

        public int? TickLabelSkip
        {
            get { return tickLabelSkip; }
            set { tickLabelSkip = value; }
        }

        public int? TickMarkSkip
        {
            get { return tickMarkSkip; }
            set { tickMarkSkip = value; }
        }

        internal override void ReadXmlCore(ReadContext context)
        {
            using (var c = context.Read("serAx"))
            {
                ReadXmlBase(c);
                TickLabelSkip = c.ReadOptionalElementIntegerAttribute("tickLblSkip");
                TickMarkSkip = c.ReadOptionalElementIntegerAttribute("tickMarkSkip");
                c.WarnIf("crtExt");
            }
        }

        internal override void WriteXmlCore(WriteContext context)
        {
            using (WriteContext c = context.Write("serAx"))
            {
                WriteXmlBase(c);
                c.WriteOptionalElementIntegerAttribute("tickLblSkip", TickLabelSkip);
                c.WriteOptionalElementIntegerAttribute("tickMarkSkip", TickMarkSkip);
                c.WarnIf("crtExt");
            }
        }
    }
}